#ifndef OBJECTCOMPONENT_H_INCLUDED
#define OBJECTCOMPONENT_H_INCLUDED

#include "XGE_Common.h"
#include "Element.h"
#include "Object.h"

namespace XGE
{
    class ObjectComponent : public XGE::Element
    {
        protected:
            XGE::Object* parent;
            Ogre::String strTypeName;

        public:
            ObjectComponent(const Ogre::String& nName, const Ogre::String& nTypeName) : Element(nName) { strTypeName = nTypeName; };
            virtual ~ObjectComponent() {};

            //Returns the TypeName of this Object Component
            Ogre::String getTypeName(void) { return strTypeName; };
            //Sets the Parent Object of this Object Component
            void setParent(XGE::Object* nParent) { parent = nParent; };

            //What this Object Component should do when activated directly
            virtual void activate(const Ogre::FrameEvent& evt) = 0;
            //What this Object Component should do when deactivated directly
            virtual void deactivate(const Ogre::FrameEvent& evt) = 0;
            //Creates a new instance of this Object Component (Proper memory allocation)
            virtual ObjectComponent* _clone(const Ogre::String& nName) = 0;
            //Updates this Object Component
            virtual bool _update(void) = 0;
    };
}

#endif // OBJECTCOMPONENT_H_INCLUDED
